package com.example.zproject.service.impl;

import cn.hutool.crypto.SecureUtil;
import com.example.zproject.dao.impl.UserDaoimpl;
import com.example.zproject.entity.UserEntity;
import com.example.zproject.service.UserService;

import java.sql.SQLException;

public class UserServerimpl implements UserService {
    @Override
    public void register(UserEntity user) throws SQLException {
        // TODO 用户注册功能
        System.out.println("UserService 处理注册"+ user);

        UserDaoimpl userdao = new UserDaoimpl();

        String password = user.getPassword();
        String md5 = SecureUtil.md5(password);
        user.setPassword(md5);
        userdao.save(user);

    }

}
